StatesMachine

interface StatesMachine<T : State> : StatesHandler<T, T>

Default StatesMachine may startChain and use inside logic for handling States. By default you may use DefaultStatesMachine or build it with dev.inmo.micro_utils.fsm.common.dsl.buildFSM. Implementers MUST NOT start handling until start method will be called

Types

Companion
Link copied to clipboard
common
object Companion

Functions

handleState
Link copied to clipboard
common
abstract suspend fun StatesMachine<in T>.handleState(state: T): T?

Main handling of state. In case when this state leads to another State and handleState returns not null State it is assumed that chain is not completed.

launchStateHandling
Link copied to clipboard
common
open suspend fun launchStateHandling(state: T, handlers: List<CustomizableHandlerHolder<in T, T>>): T?
start
Link copied to clipboard
common
abstract fun start(scope: CoroutineScope): Job

Starts handling of States

startChain
Link copied to clipboard
common
abstract suspend fun startChain(state: T)

Start chain of States witn state

Inheritors

DefaultStatesMachine
Link copied to clipboard